﻿namespace TroubleshootingofBeanBagAssistant.lCheck
{
	public class AllowAccessToMicrophoneDeviceLevelCheck : IDiagnosticCheck
	{
		public string Name => "检查并修复允许访问此设备上的麦克风（设备级）";

		public CheckResult Run()
		{
			if (!SystemMicrophone.IsDeviceMicrophoneAccessAllowed())
			{
				SystemMicrophone.EnableDeviceMicrophoneAccess();
				return new CheckResult
				{
					Title = "检测到设备级麦克风访问未开启，已自动开启",
					Detail = ""
				};
			}
			else
			{
				return new CheckResult
				{
					Title = "设备级麦克风访问已开启",
					Detail = "已开启"
				};
			}
		}
	}
}
